package com.ruoyi.wcf.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wcf.mapper.WcfMobileBrandMapper;
import com.ruoyi.wcf.domain.WcfMobileBrand;
import com.ruoyi.wcf.service.IWcfMobileBrandService;

/**
 * 手机品牌Service业务层处理
 *
 * @author WZP
 * @date 2022-04-02
 */
@Service
public class WcfMobileBrandServiceImpl implements IWcfMobileBrandService
{
    @Autowired
    private WcfMobileBrandMapper wcfMobileBrandMapper;

    /**
     * 查询手机品牌
     *
     * @param brandId 手机品牌主键
     * @return 手机品牌
     */
    @Override
    public WcfMobileBrand selectWcfMobileBrandByBrandId(Long brandId)
    {
        return wcfMobileBrandMapper.selectWcfMobileBrandByBrandId(brandId);
    }

    /**
     * 查询手机品牌列表
     *
     * @param wcfMobileBrand 手机品牌
     * @return 手机品牌
     */
    @Override
    public List<WcfMobileBrand> selectWcfMobileBrandList(WcfMobileBrand wcfMobileBrand)
    {
        return wcfMobileBrandMapper.selectWcfMobileBrandList(wcfMobileBrand);
    }

    /**
     * 新增手机品牌
     *
     * @param wcfMobileBrand 手机品牌
     * @return 结果
     */
    @Override
    public int insertWcfMobileBrand(WcfMobileBrand wcfMobileBrand)
    {
        wcfMobileBrand.setCreateAt(new Date());
        return wcfMobileBrandMapper.insertWcfMobileBrand(wcfMobileBrand);
    }

    /**
     * 修改手机品牌
     *
     * @param wcfMobileBrand 手机品牌
     * @return 结果
     */
    @Override
    public int updateWcfMobileBrand(WcfMobileBrand wcfMobileBrand)
    {
        wcfMobileBrand.setUpdateAt(new Date());
        return wcfMobileBrandMapper.updateWcfMobileBrand(wcfMobileBrand);
    }

    /**
     * 批量删除手机品牌
     *
     * @param brandIds 需要删除的手机品牌主键
     * @return 结果
     */
    @Override
    public int deleteWcfMobileBrandByBrandIds(Long[] brandIds)
    {
        return wcfMobileBrandMapper.deleteWcfMobileBrandByBrandIds(brandIds);
    }

    /**
     * 删除手机品牌信息
     *
     * @param brandId 手机品牌主键
     * @return 结果
     */
    @Override
    public int deleteWcfMobileBrandByBrandId(Long brandId)
    {
        return wcfMobileBrandMapper.deleteWcfMobileBrandByBrandId(brandId);
    }

    /**
     * 查询手机品牌列表 下拉框
     *
     * @return 手机品牌集合
     */
    @Override
    public List<WcfMobileBrand> getList(){
        return wcfMobileBrandMapper.getList();
    }

    /**
     * app-产品检索-手机品牌列表
     */
    @Override
    public List<WcfMobileBrand> mobileBrandList(){
        return wcfMobileBrandMapper.mobileBrandList();
    }
}
